package com.mojo.controller;

import com.mojo.config.Car;
import com.mojo.config.Person;
import com.mojo.config.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author <a href="mailto:sjj@jianzhimao.com">mojo</a>
 * copyright (C), 2013-2021, 广州九尾信息科技有限公司
 * @date 2021/9/18 15:59
 */
@RestController
public class HelloController {
    @Value("${name}")
    private String name;
    @Autowired
    private User user;
    @Autowired
    private Person person;
    @Autowired
    private Car car;

    @GetMapping("hello")
    public String hello() {
        System.out.println(name);
        System.out.println(user);
        System.out.println("person>>>" + person);
        return "Hello World";
    }

    @GetMapping("car")
    public Car car() {
        return car;
    }
}
